<template>
  <div>
    <el-button size="mini" type="success" @click="to">编辑</el-button>
    <eForm ref="form" :all-data="data" :user-types="userTypes" :user-levels="userLevels" :comp-infos="compInfos" :sup_this="sup_this" :is-add="false"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    },
    userTypes: {
      type: Array,
      required: true
    },
    userLevels: {
      type: Array,
      required: true
    },
    compInfos: {
      type: Array,
      required: true
    },
    id: {
      type: Number,
      required: true,
      default: null
    },
  },
  data() {
    return {
      uid: this.id
    }
  },
  provide() {
    return {
      Edit: this
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = this.data
      _this.dialog = true
      // console.log(_this.userTypes, _this.userLevels,_this.compInfos)
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
